package cn.xxstudy.screen

import android.os.Bundle
import android.view.Gravity
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val titleView = toolbar.getChildAt(0) as TextView
        titleView.layoutParams.width = LinearLayout.LayoutParams.MATCH_PARENT
        titleView.gravity = Gravity.CENTER_HORIZONTAL
    }
}
